<?php defined('SYSPATH') or die('No direct script access.');

class Model_Mysql extends Model {
	/**
	 * 
	 * Enter description here ...
	 * @param Kohana_Database_Query $query
	 * @return  object   Database_MySQL_Result for SELECT queries
	 * @return  array    list (insert id, row count) for INSERT queries
	 * @return  integer  number of affected rows for all other queries
	 */
	protected function execute(Kohana_Database_Query $query) {
		return $query->execute();
	}
	protected function execute_single(Kohana_Database_Query $query) {
		try {
			$result = $query->execute();
		} catch(Exception $e) {
			return false;
		}
		if(count($result) > 0) {
			return $result[0];
		}
		return false;
	}
}